﻿<Window x:Class="CECB.FillMatrix_Window"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="FillMatrix_Window" 
        xmlns:toolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Input.Toolkit"      
    
           WindowStartupLocation="CenterScreen" Loaded="Window_Loaded" Background="#AA000000" AllowsTransparency="True" WindowStyle="None" WindowState="Maximized">

    <Window.Resources>
 
        <Storyboard x:Key="drop1">
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)" Storyboard.TargetName="groupBox1">
                <EasingDoubleKeyFrame KeyTime="0" Value="0.02"/>
                <EasingDoubleKeyFrame KeyTime="0:0:1" Value="1.194">
                    <EasingDoubleKeyFrame.EasingFunction>
                        <BackEase EasingMode="EaseOut" Amplitude="-3"/>
                    </EasingDoubleKeyFrame.EasingFunction>
                </EasingDoubleKeyFrame>
            </DoubleAnimationUsingKeyFrames>
            <!--<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)" Storyboard.TargetName="groupBox1">
                <EasingDoubleKeyFrame KeyTime="0" Value="-120"/>
                <EasingDoubleKeyFrame KeyTime="0:0:1" Value="23.75">
                    <EasingDoubleKeyFrame.EasingFunction>
                        <BackEase EasingMode="EaseOut" Amplitude="-3"/>
                    </EasingDoubleKeyFrame.EasingFunction>
                </EasingDoubleKeyFrame>
            </DoubleAnimationUsingKeyFrames>-->
        </Storyboard>
        <Storyboard x:Key="drop2">
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)" Storyboard.TargetName="groupBox2">
                <EasingDoubleKeyFrame KeyTime="0" Value="0.02"/>
                <EasingDoubleKeyFrame KeyTime="0:0:1" Value="1.194">
                    <EasingDoubleKeyFrame.EasingFunction>
                        <BackEase EasingMode="EaseOut" Amplitude="-3"/>
                    </EasingDoubleKeyFrame.EasingFunction>
                </EasingDoubleKeyFrame>
            </DoubleAnimationUsingKeyFrames>
            <!--<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)" Storyboard.TargetName="groupBox2">
                <EasingDoubleKeyFrame KeyTime="0" Value="-120"/>
                <EasingDoubleKeyFrame KeyTime="0:0:1" Value="23.75">
                    <EasingDoubleKeyFrame.EasingFunction>
                        <BackEase EasingMode="EaseOut" Amplitude="-3"/>
                    </EasingDoubleKeyFrame.EasingFunction>
                </EasingDoubleKeyFrame>
            </DoubleAnimationUsingKeyFrames>-->
        </Storyboard>
    </Window.Resources>


    <Grid>
        
        
        
        <Grid Margin="80,40,57,22" Width="1290" Height="678">

            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="320" />
                <ColumnDefinition Width="50"  />
                <ColumnDefinition Width="485" />
                <ColumnDefinition Width="50" />
                <ColumnDefinition Width="364" />
                <ColumnDefinition Width="21*" />
            </Grid.ColumnDefinitions>

            <Rectangle  Width="1230" Margin="5,0,34,30" Height="640" Stroke="White" RadiusY="19.5" RadiusX="19.5" StrokeThickness="4" Grid.ColumnSpan="5">
                <Rectangle.Effect>
                    <DropShadowEffect Direction="330" BlurRadius="24" ShadowDepth="13" />
                </Rectangle.Effect>
                <Rectangle.Fill>
                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                        <GradientStop Color="#FF311500" Offset="0.146" />
                        <GradientStop Color="#FFFFF5EB" Offset="1" />
                    </LinearGradientBrush>
                </Rectangle.Fill>
            </Rectangle>


            <WrapPanel Orientation="Horizontal"  Grid.Column="0" Margin="10,10,0,0" >
                <StackPanel Orientation="Vertical">
                    <Label Content="Broad Category" FontSize="16" Foreground="White"  Width="auto"  Margin="0,0,0,0" />
                    <ComboBox Height="35" Name="comboBoxMainImpactCat" Width="300" Margin="0,0,0,0" FontSize="18" >
                        <ComboBoxItem Content="Physical Environmental" />
                        <ComboBoxItem Content="Socio Environmental" />
                        <ComboBoxItem Content="Ecological" />
                    </ComboBox>
                </StackPanel>
                <StackPanel Orientation="Vertical">
                    <Label Content="Sub Component  " FontSize="16" Foreground="White"  Width="auto"  Margin="0,0,0,0" />
                    <ComboBox Height="35" Name="comboBoxComponents" Width="300" Margin="0,0,0,0" FontSize="18" DisplayMemberPath="cmpt_name" SelectedValuePath="cmpt_reference" />
                </StackPanel>
                <StackPanel Orientation="Vertical">
                    <Label Content="Impacts" FontSize="16" Foreground="White"  Width="auto"  Margin="0,0,0,0" />
                    <TextBox Grid.Column="2"   Width="300" Margin="0,0,0,0" Height="35" Name="textBoxImpactSearch" VerticalAlignment="Top" FontSize="18" Background="White" Opacity="1" HorizontalAlignment="Center" TextChanged="textBoxImpactSearch_TextChanged" PreviewTextInput="textBoxImpactSearch_PreviewTextInput" />
                </StackPanel>
                <GroupBox x:Name="groupBox1" Margin="0,0,0,0" BorderThickness="0" Height="350" Width="300">
                    <GroupBox.RenderTransform>
                        <TransformGroup>
                            <ScaleTransform/>
                            <SkewTransform/>
                            <RotateTransform/>
                            <TranslateTransform/>
                        </TransformGroup>
                    </GroupBox.RenderTransform>
                    <WrapPanel MaxWidth="320" Margin="0,0,0,0" Width="300" Height="auto" >
                        <ListBox x:Name="listBoxImpacts" ScrollViewer.CanContentScroll="False" ScrollViewer.VerticalScrollBarVisibility="Hidden" ScrollViewer.HorizontalScrollBarVisibility="Hidden" SelectionChanged="listBoxImpacts_SelectionChanged" Height="500" Background="DimGray" Width="300" BorderThickness="0">
                            <ListBox.ItemTemplate>
                                <DataTemplate>
                                    <WrapPanel Orientation="Vertical" Background="#FF3E3832" MaxWidth="280">
                                        <Label Content="{Binding impt_name}" Height="30" Width="300" Foreground="White"   HorizontalAlignment="Left" FontSize="15" />
                                        <Label Content="{Binding  impt_component}" Height="22" Width="300" Foreground="White"   HorizontalAlignment="Right" FontSize="10" />
                                    </WrapPanel>
                                </DataTemplate>
                            </ListBox.ItemTemplate>
                        </ListBox>

                        <Grid />

                    </WrapPanel>
                </GroupBox>
            </WrapPanel>
            <WrapPanel Orientation="Vertical"   Grid.Column="4" Margin="10,10,9,0" >
                <StackPanel Orientation="Vertical">
                    <Label Content="Activity Phase" FontSize="16" Foreground="White"  Width="auto"  Margin="0,0,0,0" />
                    <ComboBox Height="35" Name="comboBoxMainActivityCat" Width="300" Margin="0,0,0,0" FontSize="18" >
                        <ComboBoxItem Content="Preconstriction &amp; Mobilization" />
                        <ComboBoxItem Content="Constriction Phase" />
                        <ComboBoxItem Content="Operation &amp; Maintenance Phase" />
                    </ComboBox>
                </StackPanel>
                <StackPanel Orientation="Vertical">
                    <Label Content="Activities" FontSize="16" Foreground="White"  Width="auto"  Margin="0,0,0,0" />
                    <TextBox Grid.Column="2"   Width="300" Margin="0,10,0,0" Height="35" Name="textBoxActivitySearch" VerticalAlignment="Top" FontSize="18" Background="White" Opacity="1" HorizontalAlignment="Center" TextChanged="textBoxActivitySearch_TextChanged" PreviewTextInput="textBoxActivitySearch_PreviewTextInput" />
                </StackPanel>
                <GroupBox x:Name="groupBox2" Margin="0,0,0,0" BorderThickness="0" Height="395" Width="300">
                    <GroupBox.RenderTransform>
                        <TransformGroup>
                            <ScaleTransform/>
                            <SkewTransform/>
                            <RotateTransform/>
                            <TranslateTransform/>
                        </TransformGroup>
                    </GroupBox.RenderTransform>
                    <WrapPanel MaxWidth="320" Margin="0,0,0,0" Width="300" Height="auto" >
                        <ListBox x:Name="listBoxActivities" ScrollViewer.CanContentScroll="False" ScrollViewer.VerticalScrollBarVisibility="Hidden" ScrollViewer.HorizontalScrollBarVisibility="Hidden" SelectionChanged="listBoxActivities_SelectionChanged" Height="500" Background="DimGray" Width="300" BorderThickness="0">
                            <ListBox.ItemTemplate>
                                <DataTemplate>
                                    <WrapPanel Orientation="Vertical" Background="#FF3E3832" MaxWidth="280">
                                        <Label Content="{Binding actv_name}" Height="30" Width="300" Foreground="White"   HorizontalAlignment="Left" FontSize="15" />
                                        <Label Content="{Binding actv_phase}" Height="22" Width="300" Foreground="White"   HorizontalAlignment="Right" FontSize="10" />
                                    </WrapPanel>
                                </DataTemplate>
                            </ListBox.ItemTemplate>
                        </ListBox>
                    </WrapPanel>
                </GroupBox>
            </WrapPanel>
            <WrapPanel Orientation="Vertical" Margin="10,7,0,39" Width="3"  Grid.Column="1">
                <WrapPanel.Background>
                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                        <GradientStop Color="#FF6D6D6D" Offset="0" />
                        <GradientStop Color="#FF6D6D6D" Offset="1" />
                        <GradientStop Color="#FFEFEFEF" Offset="0.5" />
                    </LinearGradientBrush>
                </WrapPanel.Background>
                <Button Name="buttonImpactUp" Visibility="Hidden" Height="48" Width="48" Margin="0,200,0,0" Click="buttonImpactUp_Click">
                    <Button.Content>
                        <StackPanel>
                            <Image Source="images\up.png" />
                        </StackPanel>
                    </Button.Content>
                </Button>
                <Button Name="buttonImpactdown" Visibility="Hidden"  Height="48" Width="48" Margin="0,50,0,0" Click="buttonImpactdown_Click">
                    <Button.Content>
                        <StackPanel>
                            <Image Source="images\down.png" />
                        </StackPanel>
                    </Button.Content>
                </Button>
            </WrapPanel>
            <WrapPanel Orientation="Vertical" Margin="23,7,22,39" Grid.Column="3" Width="3">
                <Button Name="buttonActivityUp" Visibility="Hidden" Height="48" Width="48" Margin="2,200,0,0" Click="buttonActivityUp_Click">
                    <Button.Content>
                        <StackPanel>
                            <Image Source="images\up.png" />
                        </StackPanel>
                    </Button.Content>
                </Button>
                <Button Name="buttonActivitydown"  Visibility="Hidden" Height="48" Width="48" Margin="2,50,0,0" Click="buttonActivitydown_Click">
                    <Button.Content>
                        <StackPanel>
                            <Image Source="images\down.png" />
                        </StackPanel>
                    </Button.Content>
                </Button>
                <WrapPanel.Background>
                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                        <GradientStop Color="#FF6D6D6D" Offset="0" />
                        <GradientStop Color="#FF6D6D6D" Offset="1" />
                        <GradientStop Color="#FFEFEFEF" Offset="0.5" />
                    </LinearGradientBrush>
                </WrapPanel.Background>
            </WrapPanel>
            <WrapPanel Orientation="Vertical" Grid.Column="2" Width="480">
                <StackPanel Width="480" Margin="0,10,0,0" HorizontalAlignment="Center" Orientation="Horizontal">

                    <Label Content="Fill The Matrix Using  "  Height="50" FontSize="20" Foreground="White" Width="auto" />
                    <ComboBox Name="ComboboxSelectMatrix" Width="260" Height="35" FontSize="20" Background="Transparent" SelectionChanged="ComboboxSelectMatrix_SelectionChanged">
                        <ComboBoxItem Content="Simple Value Matrix" />
                        <ComboBoxItem Content="Leopol Matrix" />
                        
                    </ComboBox>
                </StackPanel>
                <StackPanel Orientation="Horizontal" Height="auto">
                    <Label Content="Project" Name="label_projectName" FontSize="15" Foreground="White" Margin="20,0,0,0" Width="auto" Height="35" />
                    <toolkit:AutoCompleteBox Name="ProjectAutocompleteTextBox"  Width="260" Margin="124,0,0,0" Height="35"  ValueMemberPath="proj_reference"  FilterMode="Contains"  ItemsSource="{Binding}"  TabIndex="1" IsTabStop="True"  SelectionChanged="ProjectTextBox_SelectionChanged" FontSize="18" Background="White" Opacity="1" UseLayoutRounding="False" BorderBrush="#FFF8F8F8" BorderThickness="2">
                        <toolkit:AutoCompleteBox.ItemTemplate>
                            <DataTemplate>
                                <StackPanel Orientation="Horizontal">
                                    <TextBlock Text="{Binding Path=proj_reference}"/>
                                    <TextBlock Text=" - "/>
                                    <TextBlock Text="{Binding Path=proj_name}"/>
                                </StackPanel>
                            </DataTemplate>
                        </toolkit:AutoCompleteBox.ItemTemplate>
                    </toolkit:AutoCompleteBox>
                </StackPanel>
                <StackPanel Margin="0,0,0,0" Height="35" Orientation="Horizontal">
                    <Label Content="Project Name" FontSize="15" Foreground="White" Margin="20,0,0,0" />
                    <Label Content="selected project" Name="labelProject"  FontSize="15" Foreground="White" Margin="80,0,0,0" />
                </StackPanel>
                <StackPanel>
                    <GroupBox BorderThickness="1.5" Height="70" Width="471" Margin="0,0,0,0">
                        <Grid Height="auto" Name="grid1" Width="466" Margin="0,5,0,0">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="100" />
                                <ColumnDefinition Width="350" />
                                <ColumnDefinition Width="16*" />
                            </Grid.ColumnDefinitions>
                            <StackPanel Height="auto" Grid.Column="0" HorizontalAlignment="Left" Name="stackPanel1" VerticalAlignment="Top" Width="100">
                                <StackPanel Orientation="Vertical" Width="480">
                                    <Label Content="Impact" Width="auto" FontSize="15" Foreground="White" Margin="0,0,0,0" />
                                    <Label Content="Activity" Width="auto" FontSize="15" Foreground="White" Margin="0,0,0,0" />
                                </StackPanel>
                            </StackPanel>
                            <StackPanel Height="auto" Grid.Column="1" HorizontalAlignment="Left" Name="stackPanel2" VerticalAlignment="Top" Width="354" Grid.ColumnSpan="2">
                                <StackPanel Orientation="Vertical" Name="StackPanelSelectedIA">
                                    <StackPanel Name="stackPanelImpact" Width="300">
                                        <Label Content="" Name="labelImpact"  FontSize="15" Foreground="White" Margin="0,0,0,0" HorizontalAlignment="Right" Width="321" />
                                    </StackPanel>
                                    <StackPanel Name="stackPanelActivity" Width="300">
                                        <Label Content="" Name="labelActivity" FontSize="15" Foreground="White" Margin="0,2,0,0" HorizontalAlignment="Right" Width="328" />
                                    </StackPanel>
                                </StackPanel>
                            </StackPanel>
                        </Grid>
                    </GroupBox>
                </StackPanel>
                <StackPanel>
                    <Button Name="buttonConfirm" Content="Confirm Selection" Height="30" Margin="100,10,100,0" Click="buttonConfirm_Click" Background="#FF1C891C" Foreground="White" FontSize="14" FontWeight="Bold" />
                </StackPanel>
                <StackPanel Margin="0,10,0,0"  Orientation="Horizontal" Name="stackPanelAddValues" Width="auto" VerticalAlignment="Center">
                    <StackPanel.Background>
                        <LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5">
                            <GradientStop Color="DimGray" Offset="0" />
                            <GradientStop Color="DimGray" Offset="1" />
                            <GradientStop Color="White" Offset="0.5" />
                        </LinearGradientBrush>
                    </StackPanel.Background>
                    <Label Name="lblmag"  Content="Magnitude Value"  FontSize="15" Foreground="#FF9D0000" Margin="50,10,0,0" Background="{x:Null}"></Label>
                    <TextBox Name="textBoxMagnitude" Width="50" Height="40" Margin="10,0,0,0" FontSize="25" Foreground="#FF0724BE" TextChanged="textBoxMagnitude_TextChanged" KeyDown="textBoxMagnitude_KeyDown" PreviewKeyDown="textBoxMagnitude_PreviewKeyDown" PreviewTextInput="textBoxMagnitude_PreviewTextInput" />
                    <TextBox Name="textBoxImportance" Width="50" Height="40" Margin="10,0,0,0" FontSize="25" Foreground="#FF0724BE" PreviewTextInput="textBoxImportance_PreviewTextInput" />
                    <Label Name="lblimp" Content="Importance Value" FontSize="15" Foreground="#FF9D0000" Margin="10,10,0,0" Background="{x:Null}"></Label>
                </StackPanel>
                 
                <StackPanel>
                    <Button Name="buttonAddMatrix" Content="Add to Matrix" Height="30" Margin="100,10,100,0" Click="buttonAddMatrix_Click" Background="#FFCE0000" Foreground="White" FontWeight="Bold" FontSize="14" />
                </StackPanel>
                <StackPanel Height="10">
                </StackPanel>
                <StackPanel>
                    <DataGrid ItemsSource="{Binding ModelList}" AutoGenerateColumns="False" Background="#FF3E3832" Height="250" HorizontalAlignment="Left" Margin="0,0,0,0" Name="dataGrid1" VerticalAlignment="Top" Width="auto" BorderThickness="0" CanUserDeleteRows="True" CanUserResizeColumns="False" CanUserResizeRows="False" CanUserSortColumns="False" CanUserReorderColumns="False" ColumnHeaderHeight="30"  IsReadOnly="True" MinHeight="25" RowBackground="#FFBEBBBB" SelectionMode="Single" VerticalGridLinesBrush="#FF3E3832" FontSize="14" HorizontalContentAlignment="Center">
                        <DataGrid.Columns>
                            <DataGridTextColumn Binding="{Binding impactName}" CanUserReorder="False" Header="Impact"  Width="150*" Foreground="Black"  />
                            <DataGridTextColumn Binding="{Binding activityName }" CanUserReorder="False" Header="Component" Width="150*" Foreground="Black"/>
                            <DataGridTextColumn Binding="{Binding magVal }" CanUserReorder="False" Header="Mag : Value" Width="90" Foreground="Black"/>
                            <DataGridTextColumn Binding="{Binding impVal }" CanUserReorder="False" Header="Imp : Value" Width="90" Foreground="Black"/>

                        </DataGrid.Columns>
                    </DataGrid>
                </StackPanel>
            </WrapPanel>
            
        </Grid>

        
        <Grid HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,70,80,0">
            <Image Height="32" Margin="2" Source="/CECB;component/images/closeblack.png"  Width="32" MouseLeftButtonDown="Image_MouseLeftButtonDown" />
        </Grid>
    </Grid>
</Window>
